<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="sf " uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="s " uri="http://www.springframework.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<title>编辑合同</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<%@ include file="/WEB-INF/common.jsp"%>

<link
	href="${path }/resources/css/plugins/bootstrap-table/bootstrap-table.min.css"
	rel="stylesheet">
<link href="${path }/resources/css/animate.css" rel="stylesheet">
<link href="${path }/resources/css/style.css?v=4.1.0" rel="stylesheet">

<!--dataTables css样式-->
<link rel="stylesheet" type="text/css"
	href="${path }/resources/css/jquery.dataTables.min.css">
<!--DataTables button扩展-->
<link rel="stylesheet" type="text/css"
	href="${path }/resources/css/buttons.dataTables.min.css">
<link rel="stylesheet" type="text/css"
	href="${path }/resources/css/form.css">
<link rel="stylesheet" type="text/css"
	href="${path }/resources/css/daterangepicker.css">

</head>
<style type="text/css" rel="stylesheet">
#province {
	width: 150px;
	margin-left: 20px;
	display: inline-block;
}

#city {
	width: 150px;
	margin-left: 20px;
	display: inline-block;
}

#district {
	width: 150px;
	margin-left: 20px;
	display: inline-block;
}
</style>
<body class="gray-bg" style="">
	<div>
		<h1 style="margin-left: 20px">查看合同</h1>
	</div>
	<hr>
	<!--修改的表单  -->
	<div id="" barclass="panel-body" style="margin-top: 30px">
		<form id="defaultForm"
			action="${path }/contract/updateContract.htm?Id=${content1.id}"
			method="post" data-parsley-validate
			class="form-horizontal form-label-left" enctype="multipart/form-data">
			<%-- 	<input type="hidden" name="id" value="${content.id }"> --%>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">项目名称： </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input readonly="readonly" value="${content1.projectName}"
						name="projectName" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="first-name">业主名称： </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<%-- <select id="proprietorId" class="selectpicker form-control" data-live-search="true" name="proprietorId" >
					    <c:forEach items="${proprietor}" var="proprietor" >
							<option value="${proprietor.id}"><c:out value="${proprietor.name}"/></option>
						</c:forEach>
					</select> --%>
					<input readonly="readonly" value="${content1.name}"	name="proprietorId" class="form-control col-md-7 col-xs-12">
					
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="first-name">项目负责人： </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					
					<input readonly="readonly" value="${content1.chargename}"
						name="projectCharge" class="form-control col-md-7 col-xs-12">

				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="first-name">所属城市： </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input readonly="readonly" value="${content1.province}"
							name="province" class="form-control col-md-7 col-xs-12">
						<input readonly="readonly" value="${content1.city}"
							name="city" class="form-control col-md-7 col-xs-12"> 
						<input	readonly="readonly" value="${content1.district}"
							name="district" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<%-- <div class="form-group">

				<div class="col-md-6 col-sm-6 col-xs-12">
					<label class="control-label col-md-3 col-sm-3 col-xs-12"
						for="last-name">所属城市 </label>
					<div class="col-md-6 col-sm-6 col-xs-12">
						<input readonly="readonly" value="${projectLeaderList.name}"
							name="province" class="form-control col-md-7 col-xs-12">
						<input readonly="readonly" value="${projectLeaderList.name}"
							name="city" class="form-control col-md-7 col-xs-12"> 
						<input	readonly="readonly" value="${projectLeaderList.name}"
							name="district" class="form-control col-md-7 col-xs-12">
					</div>

				</div>
			</div> --%>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">详细地址 </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input readonly="readonly" value="${content1.address}"
						name="address" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">城市合伙人： </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input readonly="readonly" value="${content1.cityPartner}"
						name="cityPartner" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">所属维保企业 </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input readonly="readonly" value="${content1.enterprisename}"
						id="maintenanceEnterpriseId" name="maintenanceEnterpriseId"
						required="required" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<%--<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">所属维保企业<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<select id="enterpriseId" class="selectpicker form-control" data-live-search="true" name="enterprise" required="required">
					    <c:forEach items="${enterprise}" var="enterprise" >
							<option value="${enterprise.id}"><c:out value="${enterprise.name}"/></option>
						</c:forEach>
					</select>
					<input type="hidden" id="enterpriseIdHidden" value="${userBasicInfo.enterpriseId}">
				</div>
			</div> --%>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">签订日期： </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<%-- <input  value="<fmt:formatDate value="${content1.signDate}" pattern="yyyy年MM月dd日" />" name="signDate" required="required" class="form-control col-md-7 col-xs-12"  maxlength="11"
					>
					 --%>
					<!-- 日历插件 -->
					<input type="text" readonly="readonly" value="${content1.signDate}"
						name="signDate" type="text"
						class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">结束日期： </label>
				<div class="col-md-6 col-sm-6 col-xs-12">

					<input type="text" readonly="readonly" value="${content1.endDate}"
						name="endDate" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">合同总价人民币（万元）： </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input type="number" readonly="readonly"
						value="${content1.totalPrice}" name="totalPrice"
						class="form-control col-md-7 col-xs-12" maxlength="11">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">建筑物使用功能： </label>
				<%-- <div class="col-md-6 col-sm-6 col-xs-12">
					<select id="enterpriseId" class="selectpicker form-control" data-live-search="true" name="buildingFunction" required="required">
					    <c:forEach items="${function}" var="buildingFunction" >
							<option value="${buildingFunction.id}"><c:out value="${buildingFunction.functionName}"/></option>
						</c:forEach>
					</select>
				</div> --%>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input readonly="readonly" value="${content1.buildingFunction}"
						name="buildingFunction" class="form-control col-md-7 col-xs-12"> 
						
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">服务电话 </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input type="number" readonly="readonly"
						value="${content1.servicePhone}" name="sevicePhone"
						class="form-control col-md-7 col-xs-12" maxlength="11">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">状态 </label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input type="text" readonly="readonly" value="${content1.status}" name="status"
					class="form-control col-md-7 col-xs-12" maxlength="11"> 
				</div>
			</div>
			<%-- <div class="form-group">

				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="first-name">状态： </label> 
					<input type="number"
					readonly="readonly" value="${content1.status}" name="status"
					class="form-control col-md-7 col-xs-12" maxlength="11"> 
					<input
					type="hidden" id="statusHidden" value="${content1.status}">
			</div> --%>
			<!-- 上传图片 -->
			<!-- <div class="form-group">
				<label for="middle-name"
					class="control-label col-md-3 col-sm-3 col-xs-12">附件：</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					 <input type="file" name="file" accept="image/gif,image/jpeg,image/jpg,image/png" value="">
						
				</div>
			</div> -->
			<div class="form-group">
				<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">

					<a href="${path }/contract/showContract.htm"
						class="btn btn-primary" style="margin-left: 500px;">返回</a>
				</div>
			</div>
		</form>

	</div>

	<!-- Peity-->
	<script src="${path }/resources/js/plugins/peity/jquery.peity.min.js"></script>

	<!-- Bootstrap table-->
	<script
		src="${path }/resources/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
	<script
		src="${path }/resources/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

	<!-- 自定义js-->
	<script src="${path }/resources/js/content.js?v=1.0.0"></script>

	<!-- jQuery Validation plugin javascript-->
	<script
		src="${path }/resources/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="${path }/resources/js/plugins/validate/messages_zh.min.js"></script>

	<!-- jQuery form  -->
	<script src="${path }/resources/js/jquery.form.min.js"></script>

	<!-- layer javascript -->
	<script src="${path }/resources/js/plugins/layer/layer.min.js"></script>

	<!-- 省市联动 -->
	<script src="${path }/resources/js/distpicker.data.js"></script>
	<script src="${path }/resources/js/distpicker.js"></script>
	<script src="${path }/resources/js/main.js"></script>
	<script src="${path }/resources/js/jquery.validate.min.js"></script>
	<script type="text/javascript">
		function changeF() {
			document.getElementById('txt').value = document
					.getElementById('buildingFunction').options[document
					.getElementById('buildingFunction').selectedIndex].value;
		}
		window.onload = function() {
			var proprietor = $("#proprietorHidden").val();//设置当前业主选中项
			$("#proprietorId").val(proprietor);

			var projectLeader = $("#projectLeaderHidden").val();//设置当前项目负责人选中项
			$("#projectCharge").val(projectLeader);

			var status = $("#statusHidden").val();
			$("input[name=status][value=" + status + "]").attr("checked", true); //设置当前状态选中项
		}
		$('#distpicker5').distpicker({
			province : '${content1.province}',
			city : '${content1.city}',
			district : '${content1.district}'
		});
	</script>
	<script type="text/javascript">
		$("#defaultForm").validate({
			onsubmit : true,// 是否在提交是验证
			onfocusout : false,// 是否在获取焦点时验证
			onkeyupd : false,// 是否在敲击键盘时验证

			rules : {
				projectName : {
					required : true
				},
				proprietorId : {
					required : true
				},
				projectCharge : {
					required : true,
				},
				address : {
					required : true,
				},
				signDate : {
					required : true,

				},
				endDate : {
					required : true,
				},
				totalPrice : {
					required : true
				},
				buildingFunction : {
					required : true,

				},
				status : {
					required : true
				},
				sevicePhone : {
					required : true,
				},
			},
			messages : {
				projectName : {
					required : "请输入项目名称"
				},
				proprietorId : {
					required : "请输入业主名称"
				},
				projectCharge : {
					required : "请输入项目负责人"
				},
				address : {
					required : "请输入详细地址"
				},
				signDate : {
					required : "请输入签订日期"

				},
				endDate : {
					required : "请输入结束日期"
				},
				totalPrice : {
					required : "请输入合同总价"
				},
				buildingFunction : {
					required : "请输入建筑使用功能"

				},
				status : {
					required : "请选择状态"
				},
				sevicePhone : {
					required : "请输入服务电话"
				},
			},
			submitHandler : function(form) {//通过之后回调
				alert("编辑成功！");
				form.submit();
			}

		});
	</script>
</body>
</html>